import { get_lid } from "@Utils/getPageDecrypt"
// 获取无流量商品卡的列表
export const getFlowProdectList = (data) => {
    return {
        url: '/compass_api/shop/product_card/channel_product/channel_product_list',
        method: 'get',
        params: {
            // page_no: 1,
            // page_size: 10
            // date_type: 23,
            // end_date: '2024/09/25 00:00:00',
            // begin_date: '2024/08/27 00:00:00',
            // activity_id: '',
            is_activity: false,
            category_code: '',
            channel: 'all',
            // product_status: 1,
            pattern: 2,
            is_asc: false,
            ...data
        }
    }

    // headers: {},
    // withCredentials: true,
    // data: {}
}
// 设置商品卡 列表配置
export const setGetConfig = (_lid) => {
    return {
        url: 'compass_api/config_center/shop/modify_index',
        method: 'post',
        data: {
            "scene_identity": "shop_traffic_analysis_channel_product",
            "index_selected_list": [
                "product_show_ucnt",
                "product_click_ucnt",
                "product_show_cnt",
                "product_click_cnt",
                "product_click_cnt_per_user",
                "product_potential_cus_click_ucnt",
                "product_old_cus_click_ucnt",
                "product_potential_cus_click_ucnt_rate",
                "product_old_cus_click_ucnt_rate",
                "prod_wish_ucnt",
                "click_add_to_cart_ucnt",
                "boost_pv",
                "product_click_ucnt_rate",
                "product_click_cnt_rate",
                "pay_converse_rate_ucnt",
                "pay_converse_cnt_rate",
                "product_show_pay_ucnt_rate",
                "product_show_pay_cnt_rate",
                "product_gpm",
                "pay_user_unit_price",
                "pay_amt",
                "pay_ucnt",
                "pay_cnt",
                "new_cus_pay_ucnt",
                "old_cus_pay_ucnt",
                "new_cus_pay_ucnt_rate",
                "old_cus_pay_ucnt_rate"
            ],
            "_lid": get_lid()
        }
    }

}

export const getFlowInfo = () => {
    return {
        url: 'ecomauth/loginv1/get_account_info',
        method: 'get',
        params: {
            login_source: 'compass',
            _lid: get_lid()
        }
    }
}


// 获取基础数据的商品列表
// export const getBaseProductList = (data) => {
//     return {
//         url: 'compass_api/shop/product/product/product_list',
//         method: 'get',
//         params: {
//             // date_type: '21' // 21 - 7  20-1  23-30
//             ...data
//         }
//     }
// }

// 获取商品卡的流量表格
export const getFlowTable = (data) => {
    return {
        url: 'compass_api/download_center/shop/download_file_sync',
        method: 'get',
        params: {
            // date_type: '21' // 21 - 7  20-1  23-30
            download_scene_identity: 'traffic_analysis_channel_product',
            sheet_name_list: 'sheet1',
            "_lid": get_lid(),
            // req_json_str,
            // file_name
            ...data
        },
        responseType: 'blob',
        runOutTimeEnd: 10000
        // headers: {
        //     "Accept-Encoding": 'gzip',
        // }
    }
}